#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <chrono>

void cortirovka(std::vector<int>& nums) {
 bool s=true;
 while(s){
  s=false;
  for(int i=0;i<nums.size()-1;i++{
   if (nums[i}>nums[i+1]){
    std::swap(nums[i],nums[i+1];
    
void bubble_sort(vector<string>& nums) {
    bool swapped = true;
    while (swapped) {
        swapped = false;
        for (int i = 0; i < nums.size() - 1; i++) {
            if (nums[i] > nums[i + 1]) {
                swap(nums[i], nums[i + 1]);
                swapped = true;
            }
        }
    }
}

int main() {
    auto start = high_resolution_clock::now();

    vector<string> m1;
    ifstream file1("m1_sorted.txt");
    string line1;
    while (getline(file1, line1)) {
        m1.push_back(line1);
    }
    file1.close();

    vector<string> m2;
    ifstream file2("m2_reverse.txt");
    string line2;
    while (getline(file2, line2)) {
        m2.push_back(line2);
    }
    file2.close();

    vector<string> m3;
    ifstream file3("m3_shuffle.txt");
    string line3;
    while (getline(file3, line3)) {
        m3.push_back(line3);
    }
    file3.close();

    bubble_sort(m1);

    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<milliseconds>(stop - start);
    cout << duration.count() << " milliseconds" << endl;

    start = high_resolution_clock::now();

    bubble_sort(m2);

    stop = high_resolution_clock::now();
    duration = duration_cast<milliseconds>(stop - start);
    cout << duration.count() << " milliseconds" << endl;
    start = high_resolution_clock::now();

#include <ctime>
unsigned int t_start=clock();
unsigned int t_finish=clock();
insigned int t_work=t_finish-t_start;
cout<<"m1_sorted"<<t_work<<"milliseconds\n";


    bubble_sort(m3);
#defile LEN 5000
 int a[LEN];
 read_from_file("m1_sorted.txt",a,LEN);
    
    stop = high_resolution_clock::now();
    duration = duration_cast<milliseconds>(stop - start);
    cout << duration.count() << " milliseconds" << endl;
    cout<<"m1_sorted.txt";
    cout<<"m2_reverse.txt";
    cout<<"m3_shuffle.txt";

    return 0;
}
